home *** CD-ROM | disk | FTP | other *** search
/ Programming a Multiplayer FPS in DirectX / Programming a Multiplayer FPS in DirectX (Companion CD).iso / DirectX / dxsdk_oct2004.exe / dxsdk.exe / Include / DShowIDL / vmr9.idl < prev    next >
Encoding:
Text File  |  2004-09-27  |  32.4 KB  |  1,091 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Public Interfaces for the DX9 Video Mixing Renderer DShow filter
  4. //
  5. // Copyright (c) 1999 - 2002, Microsoft Corporation.  All rights reserved.
  6. ///////////////////////////////////////////////////////////////////////////////
  7.  
  8. import "unknwn.idl";
  9.  
  10.  
  11. cpp_quote("#if 0")
  12. // This is temporary work around to persuade
  13. // MIDL to allow forward declarations.
  14. typedef DWORD           IDirect3DDevice9;
  15. typedef DWORD           IDirect3DSurface9;
  16. typedef DWORD           D3DFORMAT;
  17. typedef DWORD           D3DCOLOR;
  18. typedef DWORD           D3DPOOL;
  19. typedef LONGLONG        REFERENCE_TIME;
  20. typedef DWORD*          HMONITOR;
  21. typedef struct {DWORD dw1; DWORD dw2;} AM_MEDIA_TYPE;
  22. cpp_quote ("#endif")
  23.  
  24.  
  25. // public interfaces supported by the VMR9
  26.  
  27. interface IVMRSurface9;
  28.  
  29. interface IVMRSurfaceAllocator9;
  30. interface IVMRSurfaceAllocatorEx9;
  31. interface IVMRSurfaceAllocatorNotify9;
  32. interface IVMRImagePresenter9;
  33. interface IVMRImagePresenterConfig9;
  34. interface IVMRMonitorConfig9;
  35. interface IVMRWindowlessControl9;
  36.  
  37. interface IVMRMixerControl9;
  38. interface IVMRImageCompositor9;
  39. interface IVMRMixerBitmap9;
  40.  
  41.  
  42. interface IVMRFilterConfig9;
  43. interface IVMRAspectRatioControl9;
  44. interface IVMRVideoStreamControl9;
  45.  
  46.  
  47.  
  48.  
  49. ///////////////////////////////////////////////////////////////////////////////
  50. //
  51. // Allocator Presenter interfaces
  52. //
  53. ///////////////////////////////////////////////////////////////////////////////
  54.  
  55.  
  56.  
  57. //=====================================================================
  58. //
  59. // IVMRImagePresenter9
  60. //
  61. //=====================================================================
  62. typedef enum {
  63.     VMR9Sample_SyncPoint       = 0x00000001,
  64.     VMR9Sample_Preroll         = 0x00000002,
  65.     VMR9Sample_Discontinuity   = 0x00000004,
  66.     VMR9Sample_TimeValid       = 0x00000008,
  67.     VMR9Sample_SrcDstRectsValid= 0x00000010
  68. } VMR9PresentationFlags;
  69.  
  70.  
  71. typedef struct _VMR9PresentationInfo {
  72.     DWORD                   dwFlags;
  73.     IDirect3DSurface9*      lpSurf;
  74.     REFERENCE_TIME          rtStart;
  75.     REFERENCE_TIME          rtEnd;
  76.     SIZE                    szAspectRatio;
  77.     RECT                    rcSrc;
  78.     RECT                    rcDst;
  79.     DWORD                   dwReserved1;
  80.     DWORD                   dwReserved2;
  81. } VMR9PresentationInfo;
  82.  
  83. [
  84.     local,
  85.     object,
  86.     local,
  87.     uuid(69188c61-12a3-40f0-8ffc-342e7b433fd7),
  88.     helpstring("IVMRImagePresenter9 Interface"),
  89.     pointer_default(unique)
  90. ]
  91. interface IVMRImagePresenter9 : IUnknown
  92. {
  93.     HRESULT StartPresenting(
  94.         [in] DWORD_PTR dwUserID
  95.         );
  96.  
  97.     HRESULT StopPresenting(
  98.         [in] DWORD_PTR dwUserID
  99.         );
  100.  
  101.     HRESULT PresentImage(
  102.         [in] DWORD_PTR dwUserID,
  103.         [in] VMR9PresentationInfo* lpPresInfo
  104.         );
  105. };
  106.  
  107.  
  108. //=====================================================================
  109. //
  110. // IVMRSurfaceAllocator
  111. //
  112. //=====================================================================
  113. typedef enum {
  114.  
  115.     //
  116.     // surface types/usage
  117.     //
  118.     VMR9AllocFlag_3DRenderTarget        = 0x0001,
  119.     VMR9AllocFlag_DXVATarget            = 0x0002,
  120.  
  121.     //
  122.     // VMR9AllocFlag_TextureSurface can be combined with
  123.     // DXVATarget and 3DRenderTarget
  124.     //
  125.     VMR9AllocFlag_TextureSurface        = 0x0004,
  126.     VMR9AllocFlag_OffscreenSurface      = 0x0008,
  127.  
  128.     //
  129.     // The following flag applies to YUV mixing mode only
  130.     // and indicates that VMR9's mixer can accept RGB formats
  131.     // as well as the specified YUV format.
  132.     // The allocator-present can switch between the two
  133.     // surface formats dynamically.
  134.     //
  135.     VMR9AllocFlag_RGBDynamicSwitch      = 0x0010,
  136.  
  137.     VMR9AllocFlag_UsageReserved         = 0x00E0,
  138.     VMR9AllocFlag_UsageMask             = 0x00FF
  139.  
  140.     // surface
  141. } VMR9SurfaceAllocationFlags;
  142.  
  143.  
  144. typedef struct _VMR9AllocationInfo {
  145.     DWORD                   dwFlags;    // see VMR9SurfaceAllocationFlags
  146.     DWORD                   dwWidth;
  147.     DWORD                   dwHeight;
  148.     D3DFORMAT               Format;     // 0 means use a format compatible with the display
  149.     D3DPOOL                 Pool;
  150.     DWORD                   MinBuffers;
  151.     SIZE                    szAspectRatio;
  152.     SIZE                    szNativeSize;
  153. } VMR9AllocationInfo;
  154.  
  155. [
  156.     local,
  157.     object,
  158.     local,
  159.     uuid(8d5148ea-3f5d-46cf-9df1-d1b896eedb1f),
  160.     helpstring("IVMRSurfaceAllocator9 Interface"),
  161.     pointer_default(unique)
  162. ]
  163. interface IVMRSurfaceAllocator9 : IUnknown
  164. {
  165.     HRESULT InitializeDevice(
  166.         [in] DWORD_PTR dwUserID,
  167.         [in] VMR9AllocationInfo* lpAllocInfo,
  168.         [in, out] DWORD* lpNumBuffers
  169.         );
  170.  
  171.     HRESULT TerminateDevice(
  172.         [in] DWORD_PTR dwID
  173.         );
  174.  
  175.     HRESULT GetSurface(
  176.         [in] DWORD_PTR dwUserID,
  177.         [in] DWORD SurfaceIndex,
  178.         [in] DWORD SurfaceFlags,
  179.         [out] IDirect3DSurface9** lplpSurface
  180.         );
  181.  
  182.     HRESULT AdviseNotify(
  183.         [in] IVMRSurfaceAllocatorNotify9* lpIVMRSurfAllocNotify
  184.         );
  185. };
  186.  
  187. [
  188.     local,
  189.     object,
  190.     local,
  191.     uuid(6de9a68a-a928-4522-bf57-655ae3866456),
  192.     helpstring("IVMRSurfaceAllocatorEx9 Interface"),
  193.     pointer_default(unique)
  194. ]
  195. interface IVMRSurfaceAllocatorEx9 : IVMRSurfaceAllocator9
  196. {
  197.     HRESULT GetSurfaceEx(
  198.         [in] DWORD_PTR dwUserID,
  199.         [in] DWORD SurfaceIndex,
  200.         [in] DWORD SurfaceFlags,
  201.         [out] IDirect3DSurface9** lplpSurface,
  202.         [out] RECT* lprcDst
  203.         );
  204. }
  205.  
  206.  
  207. //=====================================================================
  208. //
  209. // IVMRSurfaceAllocatorNotify9
  210. //
  211. //=====================================================================
  212. [
  213.     local,
  214.     object,
  215.     local,
  216.     uuid(dca3f5df-bb3a-4d03-bd81-84614bfbfa0c),
  217.     helpstring("IVMRSurfaceAllocatorNotify9 Interface"),
  218.     pointer_default(unique)
  219. ]
  220. interface IVMRSurfaceAllocatorNotify9 : IUnknown
  221. {
  222.     HRESULT AdviseSurfaceAllocator(
  223.         [in] DWORD_PTR dwUserID,
  224.         [in] IVMRSurfaceAllocator9* lpIVRMSurfaceAllocator
  225.         );
  226.  
  227.     HRESULT SetD3DDevice(
  228.         [in] IDirect3DDevice9* lpD3DDevice,
  229.         [in] HMONITOR hMonitor
  230.         );
  231.  
  232.     HRESULT ChangeD3DDevice(
  233.         [in] IDirect3DDevice9* lpD3DDevice,
  234.         [in] HMONITOR hMonitor
  235.         );
  236.  
  237.     HRESULT AllocateSurfaceHelper(
  238.         [in] VMR9AllocationInfo* lpAllocInfo,
  239.         [in, out] DWORD* lpNumBuffers,
  240.         [out] IDirect3DSurface9** lplpSurface
  241.         );
  242.  
  243.     HRESULT NotifyEvent(
  244.         [in] LONG EventCode,
  245.         [in] LONG_PTR Param1,
  246.         [in] LONG_PTR Param2
  247.         );
  248. };
  249.  
  250.  
  251.  
  252. ///////////////////////////////////////////////////////////////////////////////
  253. //
  254. // Application control and configuration interfaces
  255. //
  256. ///////////////////////////////////////////////////////////////////////////////
  257.  
  258.  
  259. //=====================================================================
  260. //
  261. // IVMRWindowlessControl9
  262. //
  263. //=====================================================================
  264. typedef enum {
  265.     VMR9ARMode_None,
  266.     VMR9ARMode_LetterBox
  267. } VMR9AspectRatioMode;
  268.  
  269. [
  270.     local,
  271.     object,
  272.     local,
  273.     uuid(8f537d09-f85e-4414-b23b-502e54c79927),
  274.     helpstring("IVMRWindowlessControl Interface"),
  275.     pointer_default(unique)
  276. ]
  277. interface IVMRWindowlessControl9 : IUnknown
  278. {
  279.     //
  280.     //////////////////////////////////////////////////////////
  281.     // Video size and position information
  282.     //////////////////////////////////////////////////////////
  283.     //
  284.     HRESULT GetNativeVideoSize(
  285.         [out] LONG* lpWidth,
  286.         [out] LONG* lpHeight,
  287.         [out] LONG* lpARWidth,
  288.         [out] LONG* lpARHeight
  289.         );
  290.  
  291.     HRESULT GetMinIdealVideoSize(
  292.         [out] LONG* lpWidth,
  293.         [out] LONG* lpHeight
  294.         );
  295.  
  296.     HRESULT GetMaxIdealVideoSize(
  297.         [out] LONG* lpWidth,
  298.         [out] LONG* lpHeight
  299.         );
  300.  
  301.     HRESULT SetVideoPosition(
  302.         [in] const LPRECT lpSRCRect,
  303.         [in] const LPRECT lpDSTRect
  304.         );
  305.  
  306.     HRESULT GetVideoPosition(
  307.         [out] LPRECT lpSRCRect,
  308.         [out] LPRECT lpDSTRect
  309.         );
  310.  
  311.     HRESULT GetAspectRatioMode(
  312.         [out] DWORD* lpAspectRatioMode
  313.         );
  314.  
  315.     HRESULT SetAspectRatioMode(
  316.         [in] DWORD AspectRatioMode
  317.         );
  318.  
  319.     //
  320.     //////////////////////////////////////////////////////////
  321.     // Display and clipping management
  322.     //////////////////////////////////////////////////////////
  323.     //
  324.     HRESULT SetVideoClippingWindow(
  325.         [in] HWND hwnd
  326.         );
  327.  
  328.     HRESULT RepaintVideo(
  329.         [in] HWND hwnd,
  330.         [in] HDC hdc
  331.         );
  332.  
  333.     HRESULT DisplayModeChanged();
  334.  
  335.  
  336.     //
  337.     //////////////////////////////////////////////////////////
  338.     // GetCurrentImage
  339.     //
  340.     // Returns the current image being displayed.  This images
  341.     // is returned in the form of packed Windows DIB.
  342.     //
  343.     // GetCurrentImage can be called at any time, also
  344.     // the caller is responsible for free the returned memory
  345.     // by calling CoTaskMemFree.
  346.     //
  347.     // Excessive use of this function will degrade video
  348.     // playback performed.
  349.     //////////////////////////////////////////////////////////
  350.     //
  351.     HRESULT GetCurrentImage(
  352.         [out] BYTE** lpDib
  353.         );
  354.  
  355.     //
  356.     //////////////////////////////////////////////////////////
  357.     // Border Color control
  358.     //
  359.     // The border color is color used to fill any area of the
  360.     // the destination rectangle that does not contain video.
  361.     // It is typically used in two instances.  When the video
  362.     // straddles two monitors and when the VMR is trying
  363.     // to maintain the aspect ratio of the movies by letter
  364.     // boxing the video to fit within the specified destination
  365.     // rectangle. See SetAspectRatioMode above.
  366.     //////////////////////////////////////////////////////////
  367.     //
  368.     HRESULT SetBorderColor(
  369.         [in] COLORREF Clr
  370.         );
  371.  
  372.     HRESULT GetBorderColor(
  373.         [out] COLORREF* lpClr
  374.         );
  375. };
  376.  
  377.  
  378.  
  379. //=====================================================================
  380. //
  381. // IVMRMixerControl9
  382. //
  383. //=====================================================================
  384.  
  385. typedef enum {
  386.     MixerPref9_NoDecimation             = 0x00000001, // No decimation - full size
  387.     MixerPref9_DecimateOutput           = 0x00000002, // decimate output by 2 in x & y
  388.     MixerPref9_ARAdjustXorY             = 0x00000004, // adjust the aspect ratio in x or y
  389.     MixerPref9_NonSquareMixing          = 0x00000008, // assume AP can handle non-square mixing, avoids intermediate scales
  390.     MixerPref9_DecimateMask             = 0x0000000F,
  391.  
  392.     MixerPref9_BiLinearFiltering        = 0x00000010, // use bi-linear filtering
  393.     MixerPref9_PointFiltering           = 0x00000020, // use point filtering
  394.     MixerPref9_AnisotropicFiltering     = 0x00000040, //
  395.     MixerPref9_PyramidalQuadFiltering   = 0x00000080, // 4-sample tent
  396.     MixerPref9_GaussianQuadFiltering    = 0x00000100, // 4-sample gaussian
  397.     MixerPref9_FilteringReserved        = 0x00000E00, // bits reserved for future use.
  398.     MixerPref9_FilteringMask            = 0x00000FF0, // OR of all above flags
  399.  
  400.     MixerPref9_RenderTargetRGB          = 0x00001000,
  401.     MixerPref9_RenderTargetYUV          = 0x00002000, // Uses DXVA to perform mixing
  402.     MixerPref9_RenderTargetReserved     = 0x000FC000, // bits reserved for future use.
  403.     MixerPref9_RenderTargetMask         = 0x000FF000, // OR of all above flags
  404.  
  405.     //
  406.     // Dynamic changes that can be performed when the VMR's mixer is
  407.     // configured to use the YUV Render target (see MixerPref_RenderTargetYUV)
  408.     // These preferences can be applied while the graph is running and take effect
  409.     // when the next frame is composed by the mixer.
  410.     //
  411.     MixerPref9_DynamicSwitchToBOB       = 0x00100000,
  412.     MixerPref9_DynamicDecimateBy2       = 0x00200000,
  413.  
  414.     MixerPref9_DynamicReserved          = 0x00C00000,
  415.     MixerPref9_DynamicMask              = 0x00F00000
  416.  
  417. } VMR9MixerPrefs;
  418.  
  419.  
  420. //
  421. //  Normalized relative rectangle
  422. //  Coordinate ranges: x=[0...1) y=[0...1)
  423. //  Where the output window goes from 0,0 (closed inclusive lower bound)
  424. //  to 1,1 (open exclusive upper bound)
  425. //
  426. typedef struct _VMR9NormalizedRect
  427. {
  428.     float left;
  429.     float top;
  430.     float right;
  431.     float bottom;
  432. } VMR9NormalizedRect;
  433.  
  434.  
  435.  
  436. typedef enum {
  437.     ProcAmpControl9_Brightness            = 0x00000001,
  438.     ProcAmpControl9_Contrast              = 0x00000002,
  439.     ProcAmpControl9_Hue                   = 0x00000004,
  440.     ProcAmpControl9_Saturation            = 0x00000008,
  441.     ProcAmpControl9_Mask                  = 0x0000000F
  442. } VMR9ProcAmpControlFlags;
  443.  
  444. typedef struct _VMR9ProcAmpControl
  445. {
  446.     DWORD       dwSize;
  447.     DWORD       dwFlags;
  448.     float       Brightness;
  449.     float       Contrast;
  450.     float       Hue;
  451.     float       Saturation;
  452. } VMR9ProcAmpControl;
  453.  
  454. typedef struct _VMR9ProcAmpControlRange
  455. {
  456.     DWORD                       dwSize;
  457.     VMR9ProcAmpControlFlags     dwProperty; // see VMR9ProcAmpControlFlags above
  458.     float                       MinValue;
  459.     float                       MaxValue;
  460.     float                       DefaultValue;
  461.     float                       StepSize;
  462. } VMR9ProcAmpControlRange;
  463.  
  464.  
  465. [
  466.     local,
  467.     object,
  468.     local,
  469.     uuid(1a777eaa-47c8-4930-b2c9-8fee1c1b0f3b),
  470.     helpstring("IVMRMixerControl9 Interface"),
  471.     pointer_default(unique)
  472. ]
  473. interface IVMRMixerControl9 : IUnknown
  474. {
  475.     HRESULT SetAlpha(
  476.         [in] DWORD dwStreamID,
  477.         [in] float Alpha // Source alpha premultication factor (global alpha for source)
  478.         );
  479.  
  480.     HRESULT GetAlpha(
  481.         [in] DWORD dwStreamID,
  482.         [out] float* pAlpha
  483.         );
  484.  
  485.     HRESULT SetZOrder(
  486.         [in] DWORD dwStreamID,
  487.         [in] DWORD dwZ
  488.         );
  489.  
  490.     HRESULT GetZOrder(
  491.         [in] DWORD dwStreamID,
  492.         [out] DWORD* pZ
  493.         );
  494.  
  495.     HRESULT SetOutputRect(
  496.         [in] DWORD dwStreamID,
  497.         [in] const VMR9NormalizedRect *pRect
  498.         );
  499.  
  500.     HRESULT GetOutputRect(
  501.         [in] DWORD dwStreamID,
  502.         [out] VMR9NormalizedRect *pRect
  503.         );
  504.  
  505.     HRESULT SetBackgroundClr(
  506.         [in] COLORREF ClrBkg
  507.         );
  508.  
  509.     HRESULT GetBackgroundClr(
  510.         [in] COLORREF* lpClrBkg
  511.         );
  512.  
  513.     HRESULT SetMixingPrefs(
  514.         [in] DWORD dwMixerPrefs  // a combination of VMRMixingPrefFlags
  515.         );
  516.  
  517.     HRESULT GetMixingPrefs(
  518.         [out] DWORD* pdwMixerPrefs
  519.         );
  520.  
  521.     HRESULT SetProcAmpControl(
  522.         [in] DWORD dwStreamID,
  523.         [in] VMR9ProcAmpControl* lpClrControl
  524.         );
  525.  
  526.     HRESULT GetProcAmpControl(
  527.         [in] DWORD dwStreamID,
  528.         [in, out] VMR9ProcAmpControl* lpClrControl
  529.         );
  530.  
  531.     HRESULT GetProcAmpControlRange(
  532.         [in] DWORD dwStreamID,
  533.         [in, out] VMR9ProcAmpControlRange* lpClrControl
  534.         );
  535. };
  536.  
  537.  
  538. //=====================================================================
  539. //
  540. // IVMRMixerBitmap9
  541. //
  542. //=====================================================================
  543.  
  544. typedef struct _VMR9AlphaBitmap
  545. {
  546.     DWORD               dwFlags;        // flags word
  547.     HDC                 hdc;            // DC for the bitmap to copy
  548.     IDirect3DSurface9*  pDDS;           // D3D surface to copy
  549.     RECT                rSrc;           // rectangle to copy from the DC/DDS
  550.     VMR9NormalizedRect  rDest;          // output rectangle in composition space
  551.     FLOAT               fAlpha;         // opacity of the bitmap
  552.     COLORREF            clrSrcKey;      // src color key
  553.     DWORD               dwFilterMode;   // See "SetMixerPrefs"
  554. } VMR9AlphaBitmap;
  555.  
  556.  
  557. typedef enum {
  558.  
  559.     // Disable the alpha bitmap for now
  560.     VMR9AlphaBitmap_Disable                     = 0x00000001,
  561.  
  562.     // Take the bitmap from the HDC rather than the DirectDraw surface
  563.     VMR9AlphaBitmap_hDC                         = 0x00000002,
  564.  
  565.     // Take the entire DDraw surface - rSrc is ignored
  566.     VMR9AlphaBitmap_EntireDDS                   = 0x00000004,
  567.  
  568.     // Indicates that the clrTrans value is valid and should be
  569.     // used when blending
  570.     VMR9AlphaBitmap_SrcColorKey                 = 0x00000008,
  571.  
  572.     // Indicates that the rSrc rectangle is valid and specifies a
  573.     // sub-rectangle of the of original app image to be blended.
  574.     // Use of this parameter enables "Image Strips"
  575.     VMR9AlphaBitmap_SrcRect                     = 0x00000010,
  576.  
  577.     // Indicates that dwFilterMode parameter is valid and should be
  578.     // used to overide the default filtering method used by the VMR.
  579.     // MixerPref_PointFiltering is particulaly useful for images that
  580.     // contain text and do not need to be stretch prior to blending with
  581.     // the video content.
  582.     VMR9AlphaBitmap_FilterMode                  = 0x00000020
  583. } VMR9AlphaBitmapFlags;
  584.  
  585. [
  586.     object,
  587.     local,
  588.     uuid(ced175e5-1935-4820-81bd-ff6ad00c9108),
  589.     helpstring("IVMRMixerBitmap Interface"),
  590.     pointer_default(unique)
  591. ]
  592. interface IVMRMixerBitmap9 : IUnknown
  593. {
  594.     // Set bitmap, location to blend it, and blending value
  595.     HRESULT SetAlphaBitmap(
  596.         [in] const VMR9AlphaBitmap* pBmpParms
  597.         );
  598.  
  599.     // Change bitmap location, size and blending value,
  600.     // graph must be running for change to take effect.
  601.     HRESULT UpdateAlphaBitmapParameters(
  602.         [in] const VMR9AlphaBitmap* pBmpParms
  603.         );
  604.  
  605.     // Get bitmap, location to blend it, and blending value
  606.     HRESULT GetAlphaBitmapParameters(
  607.         [out] VMR9AlphaBitmap* pBmpParms
  608.         );
  609. };
  610.  
  611.  
  612.  
  613. //=====================================================================
  614. //
  615. // IVMRSurface9
  616. //
  617. //=====================================================================
  618. [
  619.     local,
  620.     object,
  621.     local,
  622.     uuid(dfc581a1-6e1f-4c3a-8d0a-5e9792ea2afc),
  623.     helpstring("IVMRSurface Interface"),
  624.     pointer_default(unique)
  625. ]
  626. interface IVMRSurface9 : IUnknown
  627. {
  628.     HRESULT IsSurfaceLocked();
  629.  
  630.     HRESULT LockSurface(
  631.         [out] BYTE** lpSurface
  632.         );
  633.  
  634.     HRESULT UnlockSurface();
  635.  
  636.     HRESULT GetSurface(
  637.         [out] IDirect3DSurface9** lplpSurface
  638.         );
  639. };
  640.  
  641.  
  642.  
  643. //=====================================================================
  644. //
  645. // IID_IVMRImagePresenterConfig9 - this interface allows applications
  646. // to configure the default Microsoft provided allocator-presenter
  647. // inorder to simplify the implementation of their own
  648. // allocator-presenter plug-in.
  649. //
  650. //=====================================================================
  651. typedef enum {
  652.     RenderPrefs9_DoNotRenderBorder           = 0x00000001, // app paints color keys
  653.     RenderPrefs9_Mask                        = 0x00000001, // OR of all above flags
  654. } VMR9RenderPrefs;
  655. [
  656.     local,
  657.     object,
  658.     local,
  659.     uuid(45c15cab-6e22-420a-8043-ae1f0ac02c7d),
  660.     helpstring("IVMRImagePresenterConfig9 Interface"),
  661.     pointer_default(unique)
  662. ]
  663.  
  664. interface IVMRImagePresenterConfig9 : IUnknown
  665. {
  666.  
  667.     HRESULT SetRenderingPrefs(
  668.         [in] DWORD dwRenderFlags   // see VMRRenderPrefs for valid flags
  669.         );
  670.  
  671.     HRESULT GetRenderingPrefs(
  672.         [out] DWORD* dwRenderFlags // see VMRRenderPrefs for valid flags
  673.         );
  674.  
  675. }
  676.  
  677.  
  678.  
  679.  
  680. //=====================================================================
  681. //
  682. // IVMRVideoStreamControl9
  683. //
  684. //=====================================================================
  685. [
  686.     object,
  687.     local,
  688.     uuid(d0cfe38b-93e7-4772-8957-0400c49a4485),
  689.     helpstring("IVMRMixerStreamConfig Interface"),
  690.     pointer_default(unique)
  691. ]
  692. interface IVMRVideoStreamControl9: IUnknown
  693. {
  694.  
  695.     HRESULT SetStreamActiveState(
  696.             [in] BOOL fActive
  697.             );
  698.  
  699.     HRESULT GetStreamActiveState(
  700.             [out] BOOL* lpfActive
  701.             );
  702. };
  703.  
  704.  
  705. typedef enum {
  706.     VMR9Mode_Windowed                        = 0x00000001,
  707.     VMR9Mode_Windowless                      = 0x00000002,
  708.     VMR9Mode_Renderless                      = 0x00000004,
  709.  
  710.     // not a valid value to pass to SetRenderMode
  711.     VMR9Mode_Mask                            = 0x00000007, // OR of all above flags
  712. } VMR9Mode;
  713.  
  714. [
  715.     object,
  716.     local,
  717.     uuid(5a804648-4f66-4867-9c43-4f5c822cf1b8),
  718.     helpstring("IVMRFilterConfig9 Interface"),
  719.     pointer_default(unique)
  720. ]
  721. interface IVMRFilterConfig9 : IUnknown
  722. {
  723.     HRESULT SetImageCompositor(
  724.             [in] IVMRImageCompositor9* lpVMRImgCompositor
  725.             );
  726.  
  727.     HRESULT SetNumberOfStreams(
  728.             [in] DWORD dwMaxStreams
  729.             );
  730.  
  731.     HRESULT GetNumberOfStreams(
  732.             [out] DWORD* pdwMaxStreams
  733.             );
  734.  
  735.     HRESULT SetRenderingPrefs(
  736.             [in] DWORD dwRenderFlags  // a combination of VMR9RenderPrefs
  737.             );
  738.  
  739.     HRESULT GetRenderingPrefs(
  740.             [out] DWORD* pdwRenderFlags
  741.             );
  742.  
  743.     HRESULT SetRenderingMode(
  744.             [in] DWORD Mode  // a combination of VMRMode
  745.             );
  746.  
  747.     HRESULT GetRenderingMode(
  748.             [out] DWORD* pMode
  749.             );
  750. }
  751.  
  752. //=====================================================================
  753. //
  754. // IVMRAspectRatioControl9
  755. //
  756. //=====================================================================
  757. [
  758.     object,
  759.     local,
  760.     uuid(00d96c29-bbde-4efc-9901-bb5036392146),
  761.     helpstring("IVMRAspectRatioControl9 Interface"),
  762.     pointer_default(unique)
  763. ]
  764. interface IVMRAspectRatioControl9 : IUnknown
  765. {
  766.     HRESULT GetAspectRatioMode(
  767.         [out] LPDWORD lpdwARMode
  768.             );
  769.  
  770.     HRESULT SetAspectRatioMode(
  771.         [in] DWORD dwARMode
  772.             );
  773. }
  774.  
  775. ///////////////////////////////////////////////////////////////////////////////
  776. //
  777. // VMR Multimon configuration interface
  778. //
  779. ///////////////////////////////////////////////////////////////////////////////
  780. #define VMR9DEVICENAMELEN 32
  781. #define VMR9DEVICEDESCRIPTIONLEN  512
  782.  
  783. typedef struct _VMR9MonitorInfo {
  784.     UINT        uDevID;
  785.     RECT        rcMonitor;
  786.     HMONITOR    hMon;
  787.     DWORD       dwFlags;    // described in MONITORINFOEX, currently only MONITORINFOF_PRIMARY
  788.     wchar_t     szDevice[VMR9DEVICENAMELEN];
  789.     wchar_t     szDescription[VMR9DEVICEDESCRIPTIONLEN];
  790.     LARGE_INTEGER liDriverVersion;
  791.     DWORD       dwVendorId;
  792.     DWORD       dwDeviceId;
  793.     DWORD       dwSubSysId;
  794.     DWORD       dwRevision;
  795.     //
  796. } VMR9MonitorInfo;
  797.  
  798. [
  799.     object,
  800.     local,
  801.     uuid(46c2e457-8ba0-4eef-b80b-0680f0978749),
  802.     helpstring("IVMRMonitorConfig9 Interface"),
  803.     pointer_default(unique)
  804. ]
  805. interface IVMRMonitorConfig9 : IUnknown
  806. {
  807.     // Use this method on a Multi-Monitor system to specify to the
  808.     // mixer filter which Direct Draw driver should be used when connecting
  809.     // to an upstream decoder filter.
  810.     //
  811.     HRESULT SetMonitor(
  812.         [in] UINT uDev
  813.         );
  814.  
  815.     // Use this method to determine the direct draw object that will be used when
  816.     // connecting the  mixer filter to an upstream decoder filter.
  817.     //
  818.     HRESULT GetMonitor(
  819.         [out] UINT *puDev
  820.         );
  821.  
  822.     // Use this method on a multi-monitor system to specify to the
  823.     //  mixer filter the default Direct Draw device to use when
  824.     // connecting to an upstream filter.  The default direct draw device
  825.     // can be overriden for a particular connection by SetMonitor method
  826.     // described above.
  827.     //
  828.     HRESULT SetDefaultMonitor(
  829.         [in] UINT uDev
  830.         );
  831.  
  832.     // Use this method on a multi-monitor system to determine which
  833.     // is the default direct draw device the overlay mixer filter
  834.     // will  use when connecting to an upstream filter.
  835.     //
  836.     HRESULT GetDefaultMonitor(
  837.         [out] UINT* puDev
  838.         );
  839.  
  840.     // Use this method to get a list of Direct Draw device GUIDs and thier
  841.     // associated monitor information that the mixer can use when
  842.     // connecting to an upstream decoder filter.  Passing down a NULL pInfo
  843.     // parameter allows the app to determine the required array size (returned
  844.     // in pdwNumDevices).  Otherwise, dwNumDevices returns the actual
  845.     // number of devices retrieved.
  846.     //
  847.     HRESULT GetAvailableMonitors(
  848.         [out, size_is(dwMaxInfoArraySize)] VMR9MonitorInfo* pInfo,
  849.         [in] DWORD dwMaxInfoArraySize, // in array members
  850.         [out] DWORD* pdwNumDevices // actual number of devices retrieved
  851.         );
  852. };
  853.  
  854.  
  855. //=====================================================================
  856. //
  857. // IVMRDeinterlaceControl
  858. //
  859. // New interfaced introduced into the WindowsXP SP1 release of the VMR.
  860. // This interface allows applications to control the DX-VA deinterlacing
  861. // support provided by the VMR.
  862. //
  863. // The VMR needs to be set into "mixing" mode for this interface to work.
  864. //
  865. // SetDeinterlaceMode is only effective for new connections made to the
  866. // VMR.  It should be noted that the graphics device driver may refuse
  867. // to use the specified deinterlace mode, in which case 3 fallback
  868. // policies are offered by the VMR, these being:
  869. //
  870. //      1. Fallback to the next best mode offered by the driver.
  871. //      2. Fallback to the BOB deinterlace mode.
  872. //      3. Fallback to the WEAVE deinterlace mode (ie. turn deinterlacing off).
  873. //
  874. //=====================================================================
  875.  
  876. typedef enum {
  877.     DeinterlacePref9_NextBest = 0x01,
  878.     DeinterlacePref9_BOB = 0x02,
  879.     DeinterlacePref9_Weave = 0x04,
  880.     DeinterlacePref9_Mask = 0x07
  881. } VMR9DeinterlacePrefs;
  882.  
  883. typedef enum {
  884.  
  885.     // the algorithm is unknown or proprietary
  886.     DeinterlaceTech9_Unknown                = 0x0000,
  887.  
  888.     // the algorithm creates the missing lines by repeating
  889.     // the line either above or below it - this method will look very jaggy and
  890.     // isn't recommended
  891.     DeinterlaceTech9_BOBLineReplicate       = 0x0001,
  892.  
  893.  
  894.     // the algorithm creates the missing lines by vertically stretching each
  895.     // video field by a factor of two, for example by averaging two lines or
  896.     // using a [-1, 9, 9, -1]/16 filter across four lines.
  897.     // Slight vertical adjustments are made to ensure that the resulting image
  898.     // does not "bob" up and down.
  899.     DeinterlaceTech9_BOBVerticalStretch     = 0x0002,
  900.  
  901.     // the pixels in the missing line are recreated by a median filtering operation
  902.     DeinterlaceTech9_MedianFiltering        = 0x0004,
  903.  
  904.     // the pixels in the missing line are recreated by an edge filter.
  905.     // In this process, spatial directional filters are applied to determine
  906.     // the orientation of edges in the picture content, and missing
  907.     // pixels are created by filtering along (rather than across) the
  908.     // detected edges.
  909.     DeinterlaceTech9_EdgeFiltering          = 0x0010,
  910.  
  911.     // the pixels in the missing line are recreated by switching on a field by
  912.     // field basis between using either spatial or temporal interpolation
  913.     // depending on the amount of motion.
  914.     DeinterlaceTech9_FieldAdaptive          = 0x0020,
  915.  
  916.     // the pixels in the missing line are recreated by switching on a pixel by pixel
  917.     // basis between using either spatial or temporal interpolation depending on
  918.     // the amount of motion..
  919.     DeinterlaceTech9_PixelAdaptive          = 0x0040,
  920.  
  921.     // Motion Vector Steering  identifies objects within a sequence of video
  922.     // fields.  The missing pixels are recreated after first aligning the
  923.     // movement axes of the individual objects in the scene to make them
  924.     // parallel with the time axis.
  925.     DeinterlaceTech9_MotionVectorSteered      = 0x0080
  926.  
  927. } VMR9DeinterlaceTech;
  928.  
  929. typedef struct _VMR9Frequency {
  930.     DWORD dwNumerator;
  931.     DWORD dwDenominator;
  932. } VMR9Frequency;
  933.  
  934. typedef enum _VMR9_SampleFormat {
  935.     VMR9_SampleReserved      = 1,
  936.     VMR9_SampleProgressiveFrame = 2,
  937.     VMR9_SampleFieldInterleavedEvenFirst = 3,
  938.     VMR9_SampleFieldInterleavedOddFirst = 4,
  939.     VMR9_SampleFieldSingleEven = 5,
  940.     VMR9_SampleFieldSingleOdd = 6,
  941. } VMR9_SampleFormat;
  942.  
  943. typedef struct _VMR9VideoDesc {
  944.     DWORD               dwSize;
  945.     DWORD               dwSampleWidth;
  946.     DWORD               dwSampleHeight;
  947.     VMR9_SampleFormat   SampleFormat;
  948.     DWORD               dwFourCC;
  949.     VMR9Frequency       InputSampleFreq;
  950.     VMR9Frequency       OutputFrameFreq;
  951. } VMR9VideoDesc;
  952.  
  953.  
  954. typedef struct _VMR9DeinterlaceCaps {
  955.     DWORD               dwSize;
  956.     DWORD               dwNumPreviousOutputFrames;
  957.     DWORD               dwNumForwardRefSamples;
  958.     DWORD               dwNumBackwardRefSamples;
  959.     VMR9DeinterlaceTech DeinterlaceTechnology;
  960. } VMR9DeinterlaceCaps;
  961.  
  962. [
  963.     object,
  964.     local,
  965.     uuid(a215fb8d-13c2-4f7f-993c-003d6271a459),
  966.     helpstring("IVMRDeinterlaceControl9 Interface"),
  967.     pointer_default(unique)
  968. ]
  969. interface IVMRDeinterlaceControl9 : IUnknown
  970. {
  971.     //
  972.     // For the specified video description returns the
  973.     // number of deinterlacing modes available to the VMR.
  974.     // The deinterlacing modes are returned in descending
  975.     // quality order ie. the best quality mode is at
  976.     // lpdwNumDeinterlaceModes[0], the next best at
  977.     // lpdwNumDeinterlaceModes[1] and so on.
  978.     //
  979.     // To determine how big an array of guids to pass to the
  980.     // GetNumberOfDeinterlaceModes method call
  981.     // GetNumberOfDeinterlaceModes(lpVideoDescription, &dwNumModes, NULL);
  982.     //
  983.     HRESULT GetNumberOfDeinterlaceModes(
  984.         [in] VMR9VideoDesc* lpVideoDescription,
  985.         [in] [out] LPDWORD lpdwNumDeinterlaceModes,
  986.         [out] LPGUID lpDeinterlaceModes
  987.         );
  988.  
  989.     //
  990.     // For the given video description get the capabilities of the
  991.     // specified de-interlace mode.
  992.     //
  993.     HRESULT GetDeinterlaceModeCaps(
  994.         [in] LPGUID lpDeinterlaceMode,
  995.         [in] VMR9VideoDesc* lpVideoDescription,
  996.         [out] VMR9DeinterlaceCaps* lpDeinterlaceCaps
  997.         );
  998.  
  999.     //
  1000.     // Get/Set the deinterlace mode that you would like the
  1001.     // VMR to use when de-interlacing the specified stream.
  1002.     // It should be noted that the VMR may not actually be able
  1003.     // to use the requested deinterlace mode, in which case the
  1004.     // the VMR will fall back to other de-interlace modes as specified
  1005.     // by the de-interlace preferences (see SetDeinterlacePrefs below).
  1006.     //
  1007.     HRESULT GetDeinterlaceMode(
  1008.         [in] DWORD dwStreamID,
  1009.         [out] LPGUID lpDeinterlaceMode  // returns GUID_NULL if SetDeinterlaceMode
  1010.         );                              // has not been called yet.
  1011.  
  1012.     HRESULT SetDeinterlaceMode(
  1013.         [in] DWORD dwStreamID,          // use 0xFFFFFFFF to set mode for all streams
  1014.         [in] LPGUID lpDeinterlaceMode   // GUID_NULL == turn deinterlacing off
  1015.         );
  1016.  
  1017.  
  1018.     HRESULT GetDeinterlacePrefs(
  1019.         [out] LPDWORD lpdwDeinterlacePrefs
  1020.         );
  1021.  
  1022.     HRESULT SetDeinterlacePrefs(
  1023.         [in] DWORD dwDeinterlacePrefs
  1024.         );
  1025.  
  1026.     //
  1027.     // Get the DeinterlaceMode currently in use for the specified
  1028.     // video stream (ie. pin).  The returned GUID will be NULL if
  1029.     // the de-interlacing h/w has not been created by the VMR at the
  1030.     // time the function is called, or if the VMR determines that
  1031.     // this stream should not or can be de-interlaced.
  1032.     //
  1033.     HRESULT GetActualDeinterlaceMode(
  1034.         [in] DWORD dwStreamID,
  1035.         [out] LPGUID lpDeinterlaceMode
  1036.         );
  1037. };
  1038.  
  1039.  
  1040. //=====================================================================
  1041. //
  1042. // IVMRImageCompositor9
  1043. //
  1044. //=====================================================================
  1045.  
  1046. typedef struct _VMR9VideoStreamInfo {
  1047.     IDirect3DSurface9*          pddsVideoSurface;
  1048.     DWORD                       dwWidth, dwHeight;
  1049.     DWORD                       dwStrmID;
  1050.     FLOAT                       fAlpha;
  1051.     VMR9NormalizedRect          rNormal;
  1052.     REFERENCE_TIME              rtStart;
  1053.     REFERENCE_TIME              rtEnd;
  1054.     VMR9_SampleFormat           SampleFormat;
  1055. } VMR9VideoStreamInfo;
  1056. [
  1057.     local,
  1058.     object,
  1059.     local,
  1060.     uuid(4a5c89eb-df51-4654-ac2a-e48e02bbabf6),
  1061.     helpstring("IVMRImageCompositor9 Interface"),
  1062.     pointer_default(unique)
  1063. ]
  1064. interface IVMRImageCompositor9 : IUnknown
  1065. {
  1066.     HRESULT InitCompositionDevice(
  1067.         [in] IUnknown* pD3DDevice
  1068.         );
  1069.  
  1070.     HRESULT TermCompositionDevice(
  1071.         [in] IUnknown* pD3DDevice
  1072.         );
  1073.  
  1074.     HRESULT SetStreamMediaType(
  1075.         [in] DWORD dwStrmID,
  1076.         [in] AM_MEDIA_TYPE* pmt,
  1077.         [in] BOOL fTexture
  1078.         );
  1079.  
  1080.     HRESULT CompositeImage(
  1081.         [in] IUnknown* pD3DDevice,
  1082.         [in] IDirect3DSurface9* pddsRenderTarget,
  1083.         [in] AM_MEDIA_TYPE* pmtRenderTarget,
  1084.         [in] REFERENCE_TIME rtStart,
  1085.         [in] REFERENCE_TIME rtEnd,
  1086.         [in] D3DCOLOR dwClrBkGnd,
  1087.         [in] VMR9VideoStreamInfo* pVideoStreamInfo,
  1088.         [in] UINT cStreams
  1089.         );
  1090. };
  1091.